import axios from "./request";

export function getCodeFun(data) {
  return axios({
    method: "get",
    url: `/sms-code?mobile=${data.mobile}&source=1`
  });
}

export function bangdingPhone(data) {
  return axios({
    method: "post",
    url: `/binding-phone`,
    data: {
      mobile: data.mobile,
      code: data.code
    }
  });
}

export function editUserInfo(data) {
  console.log(data);
  return axios({
    method: "post",
    url: "/update-market-members",
    data: data
  });
}

export function getUserInfo() {
  return axios({
    method: "get",
    url: "/my-market-members"
  });
}

export function codeUrl() {
  return axios({
    url: "/wechat/login?market_id=12",
    method: "get"
  });
}

export function WXback(data) {
  return axios({
    method: "get",
    url: `/wechat/callback?code=${data.code}&state=${data.state}`
  });
}
